<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;
class Newregister extends  Controller
{
    public function newregister()
    {
        $res = Request::instance();
        $url = $res->root(true);

        return view('newregister',compact('url'));
    }


    public function logo(){

        $res = Request::instance();
        if($res->isPost()){
            $compayname = input('post.compayname');
            $name = input('post.name');
            $mobile  = input('post.mobile');
            $wechat = input('post.wechat');

            $arr = [
                'compayname'=>$compayname,
                'name'=>$name,
                'phone'=>$mobile,
                'wechat'=>$wechat
            ];
            $bool = Db::name('gp')->insert($arr);
            $sql = Db::name('gp')->getLastSql();
            if($bool){
                $this->success('注册成功','index/index/index');
            }
        }else{
            echo 2222;
        }


    }
}
